{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "31210b83-5127-42d0-9ce9-1cae7b6de54c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "         1          \n",
      "        1 1         \n",
      "       1 2 1        \n",
      "      1 3 3 1       \n",
      "     1 4 6 4 1      \n"
     ]
    }
   ],
   "source": [
    "#string.py\n",
    "print(\"1\".center(20))         #1行20个字符，居中对齐\n",
    "print(\"1 1\".center(20))        #1行20个字符，居中对齐\n",
    "print(format(\"1 2 1\", \"^20\"))  #1行20个字符，居中对齐\n",
    "print(format(\"1 3 3 1\", \"^20\"))  #1行20个字符，居中对齐\n",
    "print(format(\"1 4 6 4 1\", \"^20\"))\n",
    "input()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3cf45c5a-a229-4b14-944c-83b78f8bffeb",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
